<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <title>Package signup Form a Responsive Widget Template :: w3layouts</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap.min.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="${pageContext.request.contextPath}/static/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="${pageContext.request.contextPath}/static/bootstrap.min.js"></script>
</head>
<body>
<div>

<c:if test="${isUpdate == null}">
    <form class="form-horizontal" style="width:80%;" action="/user/addUser?currentPage=1&pageSize=5" method="post">
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">名字</label>
            <div class="col-sm-10">
                <input required type="text" name="name" class="form-control" id="inputEmail3" placeholder="名字">
            </div>
        </div>
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">账号id</label>
            <div class="col-sm-10">
                <input required disabled type="text" name="accountId" class="form-control" id="inputEmai27" placeholder="账号id">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">图片</label>
            <div class="col-sm-10">
                <img src="../static/register/images/head_xiaowanzi.jpg" height="50px" width="50px">
                <input hidden type="text" name="headPhoto" class="form-control" id="inputPassword3" placeholder="图片">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">签名</label>
            <div class="col-sm-10">
                <input required type="text" style="height: 150px" class="form-control" name="sign" id="inputPassword0" placeholder="签名">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">手机号</label>
            <div class="col-sm-10">
                <input required type="text" name="tel" class="form-control" id="inputPassword4" placeholder="手机号">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">qq</label>
            <div class="col-sm-10">
                <input required type="text" name="qq" class="form-control" id="inputPassword5" placeholder="qq">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">邮箱</label>
            <div class="col-sm-10">
                <input required type="text" name="email" class="form-control" id="inputPassword6" placeholder="邮箱">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <div class="checkbox">
                    <label>
                        <input type="radio" checked value="admin" name="type"> 超管用户
                        <input type="radio" disabled value="common" name="type"> 普通用户
                    </label>
                </div>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <div class="checkbox">
                    <label>
                        <input type="radio" disabled value="disabled" name="status"> 禁用
                        <input type="radio" checked value="enabled" name="status"> 正常
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default" style="width: 100px">添加</button>
            </div>
        </div>
    </form>
</c:if>

<c:if test="${isUpdate != null}">
    <form class="form-horizontal" style="width:80%;" action="/user/updateUser?currentPage=1&pageSize=5" method="post">
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">名字</label>
            <div class="col-sm-10">
                <input required type="text" name="name" value="${user.name}" class="form-control" id="inputEmail4" >
                <input type="hidden" name="userId" value="${user.userId}">
            </div>
        </div>
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">账号id</label>
            <div class="col-sm-10">
                <input disabled type="text" name="accountId" value="${user.accountId}" class="form-control" id="inputEmail4" >
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">图片</label>
            <div class="col-sm-10">
                <img src="../static/register/images/head_xiaowanzi.jpg" height="50px" width="50px">
                <input hidden type="text" name="headPhoto" value="${user.headPhoto}" class="form-control" id="inputPassword20">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">签名</label>
            <div class="col-sm-10">
                <input required type="text" style="height: 150px" class="form-control" value="${user.sign}" name="sign" id="inputPassword16" >
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">手机号</label>
            <div class="col-sm-10">
                <input required type="text" name="tel" value="${user.tel}" class="form-control" id="inputPassword17" >
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">qq</label>
            <div class="col-sm-10">
                <input required type="text" name="qq" value="${user.qq}" class="form-control" id="inputPassword18">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">邮箱</label>
            <div class="col-sm-10">
                <input required type="text" name="email" value="${user.email}" class="form-control" id="inputPassword19">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <div class="checkbox">
                    <label>
                        <c:if test="${user.type=='admin'}">
                            <input type="radio" disabled value="admin" name="type" checked> 超管用户
                            <input type="radio" disabled value="common" name="type"> 普通用户
                        </c:if>
                        <c:if test="${user.type=='common'}">
                            <input type="radio" disabled value="admin" name="type"> 超管用户
                            <input type="radio" disabled value="common" name="type" checked> 普通用户
                        </c:if>

                    </label>
                </div>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <div class="checkbox">
                    <label>
                        <c:if test="${user.status=='disabled'}">
                            <input type="radio" value="disabled" name="status" checked> 禁用
                            <input type="radio" value="enabled" name="status"> 正常
                        </c:if>
                        <c:if test="${user.status=='enabled'}">
                            <input type="radio" value="disabled" name="status"> 禁用
                            <input type="radio" value="enabled" name="status" checked> 正常
                        </c:if>

                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default" style="width: 100px">修改</button>
            </div>
        </div>
    </form>
</c:if>

</div>

</body>
</html>